<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>RaspBerryPi power control: Low level register access</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RaspBerryPi power control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Low level register access</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga5f242135f5088f8c319492426a1ed5e3"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3">bcm2835_peri_read</a> (volatile uint32_t *paddr)</td></tr>
<tr class="separator:ga5f242135f5088f8c319492426a1ed5e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f541d0997978dd30f60231b64f10230"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lowlevel.html#ga0f541d0997978dd30f60231b64f10230">bcm2835_peri_read_nb</a> (volatile uint32_t *paddr)</td></tr>
<tr class="separator:ga0f541d0997978dd30f60231b64f10230"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga639da6963ab76e3109b9909f3a9e6171"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171">bcm2835_peri_write</a> (volatile uint32_t *paddr, uint32_t value)</td></tr>
<tr class="separator:ga639da6963ab76e3109b9909f3a9e6171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c158b76d194b94d0b2fb1488f9ff30e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lowlevel.html#ga1c158b76d194b94d0b2fb1488f9ff30e">bcm2835_peri_write_nb</a> (volatile uint32_t *paddr, uint32_t value)</td></tr>
<tr class="separator:ga1c158b76d194b94d0b2fb1488f9ff30e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01949a6285305f38ce0a47154e55c1b6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6">bcm2835_peri_set_bits</a> (volatile uint32_t *paddr, uint32_t value, uint32_t mask)</td></tr>
<tr class="separator:ga01949a6285305f38ce0a47154e55c1b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These functions provide low level register access, and should not generally need to be used </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga5f242135f5088f8c319492426a1ed5e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t bcm2835_peri_read </td>
          <td>(</td>
          <td class="paramtype">volatile uint32_t *&#160;</td>
          <td class="paramname"><em>paddr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads 32 bit value from a peripheral address The read is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">paddr</td><td>Physical address to read from. See BCM2835_GPIO_BASE etc. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value read from the 32 bit register </dd></dl>
<dl class="section see"><dt>See Also</dt><dd>Physical Addresses </dd></dl>

</div>
</div>
<a class="anchor" id="ga0f541d0997978dd30f60231b64f10230"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t bcm2835_peri_read_nb </td>
          <td>(</td>
          <td class="paramtype">volatile uint32_t *&#160;</td>
          <td class="paramname"><em>paddr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads 32 bit value from a peripheral address without the read barrier You should only use this when your code has previously called <a class="el" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3">bcm2835_peri_read()</a> within the same peripheral, and no other peripheral access has occurred since. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">paddr</td><td>Physical address to read from. See BCM2835_GPIO_BASE etc. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value read from the 32 bit register </dd></dl>
<dl class="section see"><dt>See Also</dt><dd>Physical Addresses </dd></dl>

</div>
</div>
<a class="anchor" id="ga01949a6285305f38ce0a47154e55c1b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_peri_set_bits </td>
          <td>(</td>
          <td class="paramtype">volatile uint32_t *&#160;</td>
          <td class="paramname"><em>paddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Alters a number of bits in a 32 peripheral regsiter. It reads the current valu and then alters the bits deines as 1 in mask, according to the bit value in value. All other bits that are 0 in the mask are unaffected. Use this to alter a subset of the bits in a register. The write is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">paddr</td><td>Physical address to read from. See BCM2835_GPIO_BASE etc. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The 32 bit value to write, masked in by mask. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Bitmask that defines the bits that will be altered in the register. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd>Physical Addresses </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__lowlevel_ga01949a6285305f38ce0a47154e55c1b6_cgraph.png" border="0" usemap="#group__lowlevel_ga01949a6285305f38ce0a47154e55c1b6_cgraph" alt=""/></div>
<map name="group__lowlevel_ga01949a6285305f38ce0a47154e55c1b6_cgraph" id="group__lowlevel_ga01949a6285305f38ce0a47154e55c1b6_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="225,5,375,32"/><area shape="rect" id="node3" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="225,56,375,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga639da6963ab76e3109b9909f3a9e6171"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_peri_write </td>
          <td>(</td>
          <td class="paramtype">volatile uint32_t *&#160;</td>
          <td class="paramname"><em>paddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes 32 bit value from a peripheral address The write is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">paddr</td><td>Physical address to read from. See BCM2835_GPIO_BASE etc. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The 32 bit value to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd>Physical Addresses </dd></dl>

</div>
</div>
<a class="anchor" id="ga1c158b76d194b94d0b2fb1488f9ff30e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_peri_write_nb </td>
          <td>(</td>
          <td class="paramtype">volatile uint32_t *&#160;</td>
          <td class="paramname"><em>paddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes 32 bit value from a peripheral address without the write barrier You should only use this when your code has previously called <a class="el" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171">bcm2835_peri_write()</a> within the same peripheral, and no other peripheral access has occurred since. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">paddr</td><td>Physical address to read from. See BCM2835_GPIO_BASE etc. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The 32 bit value to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd>Physical Addresses </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 16 2013 16:20:03 for RaspBerryPi power control by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
